package com.neuedu.androidserver.controller;


import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;
import java.util.UUID;

@RestController
public class LoginController {


    /**
     *   http://127.0.0.1:8080/login?username=admin&password=123456
     *   http://localhost:8080/login?username=admin&password=123456
     * @param username
     * @param password
     * @return
     */
    @RequestMapping("/login")
    public Map  login(String username ,String password){

        //sssss

        Map map = new HashMap();


        if("admin".equals(username)  && "123456".equals(password)){
            map.put("code",200);
            map.put("token", UUID.randomUUID().toString());
        }else{
            map.put("code",403);
        }


        return map;

    }









}
